import React, { Component } from 'react'

export default class App extends Component {
  // 提取事件的回调
  // 能通过实例访问到 handleClick
  handleClick(e) {
    console.log(e)
  }
  render() {
    return (
      <div>
        {/* <button
          onClick={() => {
            console.log(1)
          }}
        >
          click
        </button> */}
        <button onClick={this.handleClick}>click</button>
      </div>
    )
  }
}
